/*
Copyright SecureKey Technologies Inc. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/

package api

import (
	ab "git.cloud.inspur.com/ichain/ichain-protos-go/consenser"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/context"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/ichain"
)

// Connection event连接的抽象接口
type Connection interface {
	Send(seekInfo *ab.SeekInfo) error
	Receive(chan<- interface{})
	Close()
	Closed() bool
}

type ConnectionProvider func(context context.Client, chConfig ichain.ChainCfg, inode ichain.Inode) (Connection, error)
